package cn.sundat.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.transaction.annotation.Transactional;

import cn.sundat.dao.ProductLinkDao;
import cn.sundat.model.Company;
import cn.sundat.model.ProductLink;

@Transactional
public class ProductLinkServiceImpl implements ProductLinkService {
	@Resource(name="productLinkDao")
	private ProductLinkDao productLinkDao;

	@Override
	public void save(ProductLink productLink) {
		productLinkDao.save(productLink);
	}

	@Override
	public List<ProductLink> findAll(Company company) {
		return productLinkDao.findLinkByCid(company);
	}
	
	@Override
	public ProductLink getById(String link_id) {
		ProductLink link = productLinkDao.getById(link_id);
		return link;
	}

	@Override
	public void update(ProductLink link) {
		productLinkDao.update(link);
	}

	@Override
	public void delete(ProductLink link) {
		productLinkDao.delete(link);
	}
	
}
